3.77 \(\int e^{x^2} \sin (a+c x^2) \, dx\)

Optimal. Leaf size=87 \[ \frac{i \sqrt{\pi } e^{-i a} \text{Erfi}\left (\sqrt{1-i c} x\right )}{4 \sqrt{1-i c}}-\frac{i \sqrt{\pi } e^{i a} \text{Erfi}\left (\sqrt{1+i c} x\right )}{4 \sqrt{1+i c}} \]

[Out]

((I/4)*Sqrt[Pi]*Erfi[Sqrt[1 - I*c]*x])/(Sqrt[1 - I*c]*E^(I*a)) - ((I/4)*E^(I*a)*Sqrt[Pi]*Erfi[Sqrt[1 + I*c]*x]
)/Sqrt[1 + I*c]

________________________________________________________________________________________

Rubi [A]  time = 0.0984525, antiderivative size = 87, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4472, 2204} \[ \frac{i \sqrt{\pi } e^{-i a} \text{Erfi}\left (\sqrt{1-i c} x\right )}{4 \sqrt{1-i c}}-\frac{i \sqrt{\pi } e^{i a} \text{Erfi}\left (\sqrt{1+i c} x\right )}{4 \sqrt{1+i c}} \]

Antiderivative was successfully verified.

[In]

Int[E^x^2*Sin[a + c*x^2],x]

[Out]

((I/4)*Sqrt[Pi]*Erfi[Sqrt[1 - I*c]*x])/(Sqrt[1 - I*c]*E^(I*a)) - ((I/4)*E^(I*a)*Sqrt[Pi]*Erfi[Sqrt[1 + I*c]*x]
)/Sqrt[1 + I*c]

Rule 4472

Int[(F_)^(u_)*Sin[v_]^(n_.), x_Symbol] :> Int[ExpandTrigToExp[F^u, Sin[v]^n, x], x] /; FreeQ[F, x] && (LinearQ
[u, x] || PolyQ[u, x, 2]) && (LinearQ[v, x] || PolyQ[v, x, 2]) && IGtQ[n, 0]

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rubi steps

\begin{align*} \int e^{x^2} \sin \left (a+c x^2\right ) \, dx &=\int \left (\frac{1}{2} i e^{-i a+(1-i c) x^2}-\frac{1}{2} i e^{i a+(1+i c) x^2}\right ) \, dx\\ &=\frac{1}{2} i \int e^{-i a+(1-i c) x^2} \, dx-\frac{1}{2} i \int e^{i a+(1+i c) x^2} \, dx\\ &=\frac{i e^{-i a} \sqrt{\pi } \text{erfi}\left (\sqrt{1-i c} x\right )}{4 \sqrt{1-i c}}-\frac{i e^{i a} \sqrt{\pi } \text{erfi}\left (\sqrt{1+i c} x\right )}{4 \sqrt{1+i c}}\\ \end{align*}

Mathematica [A]  time = 0.218311, size = 129, normalized size = 1.48 \[ -\frac{\sqrt [4]{-1} \sqrt{\pi } \left (\sqrt{c+i} \left (\sin (a) \text{Erf}\left (\frac{(1+i) \sqrt{c+i} x}{\sqrt{2}}\right )+\text{Erfi}\left ((-1)^{3/4} \sqrt{c+i} x\right ) (c \sin (a)+i c \cos (a)+\cos (a))\right )+\sqrt{c-i} (c+i) (\cos (a)+i \sin (a)) \text{Erfi}\left (\sqrt [4]{-1} \sqrt{c-i} x\right )\right )}{4 \left (c^2+1\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[E^x^2*Sin[a + c*x^2],x]

[Out]

-((-1)^(1/4)*Sqrt[Pi]*(Sqrt[-I + c]*(I + c)*Erfi[(-1)^(1/4)*Sqrt[-I + c]*x]*(Cos[a] + I*Sin[a]) + Sqrt[I + c]*
(Erf[((1 + I)*Sqrt[I + c]*x)/Sqrt[2]]*Sin[a] + Erfi[(-1)^(3/4)*Sqrt[I + c]*x]*(Cos[a] + I*c*Cos[a] + c*Sin[a])
)))/(4*(1 + c^2))

________________________________________________________________________________________

Maple [A]  time = 0.063, size = 62, normalized size = 0.7 \begin{align*}{-{\frac{i}{4}}\sqrt{\pi }{{\rm e}^{ia}}{\it Erf} \left ( \sqrt{-ic-1}x \right ){\frac{1}{\sqrt{-ic-1}}}}+{{\frac{i}{4}}\sqrt{\pi }{{\rm e}^{-ia}}{\it Erf} \left ( \sqrt{-1+ic}x \right ){\frac{1}{\sqrt{-1+ic}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(x^2)*sin(c*x^2+a),x)

[Out]

-1/4*I*Pi^(1/2)*exp(I*a)/(-I*c-1)^(1/2)*erf((-I*c-1)^(1/2)*x)+1/4*I*Pi^(1/2)*exp(-I*a)/(-1+I*c)^(1/2)*erf((-1+
I*c)^(1/2)*x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: IndexError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(c*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: IndexError

________________________________________________________________________________________

Fricas [A]  time = 0.482512, size = 192, normalized size = 2.21 \begin{align*} \frac{\sqrt{\pi }{\left (c + i\right )} \sqrt{-i \, c - 1} \operatorname{erf}\left (\sqrt{-i \, c - 1} x\right ) e^{\left (i \, a\right )} + \sqrt{\pi }{\left (c - i\right )} \sqrt{i \, c - 1} \operatorname{erf}\left (\sqrt{i \, c - 1} x\right ) e^{\left (-i \, a\right )}}{4 \,{\left (c^{2} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(c*x^2+a),x, algorithm="fricas")

[Out]

1/4*(sqrt(pi)*(c + I)*sqrt(-I*c - 1)*erf(sqrt(-I*c - 1)*x)*e^(I*a) + sqrt(pi)*(c - I)*sqrt(I*c - 1)*erf(sqrt(I
*c - 1)*x)*e^(-I*a))/(c^2 + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int e^{x^{2}} \sin{\left (a + c x^{2} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x**2)*sin(c*x**2+a),x)

[Out]

Integral(exp(x**2)*sin(a + c*x**2), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int e^{\left (x^{2}\right )} \sin \left (c x^{2} + a\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(c*x^2+a),x, algorithm="giac")

[Out]

integrate(e^(x^2)*sin(c*x^2 + a), x)